<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="">
	<meta name="author" content="">

	<title>Dashboard Template for Bootstrap</title>
	<link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet">

	<!-- Custom styles for this template -->
	<link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
	<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
	<style type="text/css">
		/* Chart.js */

		@-webkit-keyframes chartjs-render-animation {
			from {
				opacity: 0.99
			}
			to {
				opacity: 1
			}
		}

		@keyframes chartjs-render-animation {
			from {
				opacity: 0.99
			}
			to {
				opacity: 1
			}
		}

		.chartjs-render-monitor {
			-webkit-animation: chartjs-render-animation 0.001s;
			animation: chartjs-render-animation 0.001s;
		}
	</style>
</head>

<body>
<!--引入抽取的topbar-->
<!--模板名：会使用thymeleaf的前后缀配置规则进行解析-->
<div th:replace="commons/bar::topbar"></div>

<div class="container-fluid">
	<div class="row">
		<!--引入侧边栏-->
		<div th:replace="commons/bar::#sidebar(activeUri='/activitycategory/activitycategory')"></div>

		<n role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
			<h3>类型管理：</h3>
			<form th:action="@{/activitycategory/getactivitycategory}" method="post">
				<input type="text"  name="name" placeholder="名称" >
				<input type="submit" class="btn btn-sm btn-primary" value="搜索">
			</form>

			<div class="container">
				<!-- 按钮：用于打开模态框 -->
				<button type="button" style="float: right" class="btn btn-primary" data-toggle="modal"
						data-target="#myModal1">
					新增
				</button>

				<!-- 模态框 -->
				<div class="modal fade" id="myModal1">
					<div class="modal-dialog">
						<div class="modal-content">
							<!-- 模态框头部 -->
							<div class="modal-header">
								<h4 class="modal-title">新增活动类型</h4>
								<button type="button" class="close" data-dismiss="modal">&times;</button>
							</div>
							<form method="post" th:action="@{/activitycategory/addactivitycategory}">
								<!--<form id="addCarFormId" method="post" action="">-->
								<!-- 模态框主体 -->
								<div class="modal-body">

									<div class="form-group">
										<label class="col-sm-3 control-label">类型名称：</label>
										<div class="col-sm-9">
											<input type="text" class="form-control" name="name"
												   placeholder="类型名称">
										</div>
									</div>

									<div class="form-group">
										<label class="col-sm-3 control-label">活动数量：</label>
										<div class="col-sm-9">
											<input type="text" class="form-control" name="useCount"
												   placeholder="活动数量">
										</div>
									</div>
								</div>
								<!-- 模态框底部 -->
								<div class="modal-footer">
									<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
									<button type="submit" class="btn btn-primary">保存</button>
								</div>
							</form>
						</div>
					</div>
				</div>
				</select>
				<div class="table-responsive">
					<table class="table table-striped table-sm" style="text-align:center">
						<thead>
						<tr>
							<th>序号</th>
							<th>名称</th>
							<th>活动数量</th>
							<th>操作</th>

						</tr>
						</thead>
						<tbody>
						<tr th:each="list,activityCategory:${activityCategory}">
							<td th:text="${activityCategory.count}"></td>
							<td th:text="${list.name}"></td>
							<td th:text="${list.useCount}"></td>
							<!--<td th:text="${list.favCount}"></td>-->

							<td>
								<a class="btn btn-sm btn-primary" th:href="@{/activitycategory/updateactivitycategory/}+${list.id}">编辑</a>
								<a class="btn btn-sm btn-primary" th:href="@{/activitycategory/deleteactivitycategory/}+${list.id}">删除</a>
							</td>
						</tr>
						</tbody>
					</table>
				</div>
				</main>
				<form id="deleteEmpForm"  method="post">
					<input type="hidden" name="_method" value="delete"/>
				</form>
			</div>
	</div>

	<!-- Bootstrap core JavaScript
    ================================================== -->

</body>
</html>